<template>
  <view class="container">
    <view class="base">
      <view class="list">
        <view class="list_left">
          <view>水库名称</view>
        </view>
        <view class="list_right">
          <view>{{ info.reservoirName }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>水库代码</view>
        </view>
        <view class="list_right">
          <view>{{ info.reservoirCode }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>高程基准面</view>
        </view>
        <view class="list_right">
          <view>{{ info.gcjzm }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>所在河流名称</view>
        </view>
        <view class="list_right">
          <view>{{ info.riverName }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>所在乡镇和村</view>
        </view>
        <view class="list_right">
          <view>{{ info.szxzandc }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>所在水系</view>
        </view>
        <view class="list_right">
          <view>{{ info.szsx }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>所在流域</view>
        </view>
        <view class="list_right">
          <view>{{ info.basin }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>经度</view>
        </view>
        <view class="list_right">
          <view>{{ info.longitude }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>纬度</view>
        </view>
        <view class="list_right">
          <view>{{ info.latitude }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>注册登记号</view>
        </view>
        <view class="list_right">
          <view>{{ info.zcdjNumber }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>其他行业注册号</view>
        </view>
        <view class="list_right">
          <view>{{ info.qthyzcNumber }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>注册登记时间</view>
        </view>
        <view class="list_right">
          <view>{{ info.registrationTime }}</view>
        </view>
      </view>
      <!-- <view class="list">
        <view class="list_left">
          <view>行政区划</view>
        </view>
        <view class="list_right">
          <view>{{ info.xzqhArr }}</view>
        </view>
      </view> -->
      <view class="list">
        <view class="list_left">
          <view>水库类别</view>
        </view>
        <view class="list_right">
          <view>{{ info.reservoirCategory }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>水库类型</view>
        </view>
        <view class="list_right">
          <view>{{ info.reservoirType }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>主要建筑物级别</view>
        </view>
        <view class="list_right">
          <view>{{ info.zyjzwLevel }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>工程等别</view>
        </view>
        <view class="list_right">
          <view>{{ info.engineeringLevel }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>工程规模</view>
        </view>
        <view class="list_right">
          <view>{{ info.engineeringScale }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>水库功能</view>
        </view>
        <view class="list_right">
          <view>{{ info.reservoirFunctionArr }}</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>水库总库容</view>
        </view>
        <view class="list_right">
          <view>{{ info.totalCapacity }} 万m³</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>兴利库容</view>
        </view>
        <view class="list_right">
          <view>{{ info.powerCapacity }} 万m³</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>死库容</view>
        </view>
        <view class="list_right">
          <view>{{ info.deadCapacity }} 万m³</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>设计洪水位</view>
        </view>
        <view class="list_right">
          <view>{{ info.designFloodLevel }} m</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>正常蓄水位</view>
        </view>
        <view class="list_right">
          <view>{{ info.normalStorageLevel }} m</view>
        </view>
      </view>
      <view class="list">
        <view class="list_left">
          <view>死水位</view>
        </view>
        <view class="list_right">
          <view>{{ info.deadWaterLevel }} m</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  import dayjs from '@/utlis/dayjs.min';

  export default {
    data() {
      return {
        info: {},
        reclass: [],
        retype: [],
        dzzyjzwjb: [],
        regcdb: [],
        regcgm: [],
        reuse: [],
        treeData: [],
      }
    },
    onLoad(options) {
      this.dictionary()
    },
    onShow() {
      this.getBase()
    },
    methods: {
      dictionary() {
        this.$request.re_class().then(res => {
          this.reclass = res.data || []
        })
        this.$request.re_type().then(res => {
          this.retype = res.data || []
        })
        this.$request.dz_zyjzwjb().then(res => {
          this.dzzyjzwjb = res.data || []
        })
        this.$request.re_gcdb().then(res => {
          this.regcdb = res.data || []
        })
        this.$request.re_gcgm().then(res => {
          this.regcgm = res.data || []
        })
        this.$request.re_use().then(res => {
          this.reuse = res.data || []
        })
        
      },
      getBase() {
        this.$request.getBaseList().then(res => {
          let info = res.rows[0] || {}
          info.registrationTime = dayjs(info.registrationTime).format('YYYY-MM-DD HH:mm:ss')
          info.reservoirCategory = this.reclass[info.reservoirCategory].dictLabel
          info.reservoirType = this.retype[info.reservoirType].dictLabel
          info.zyjzwLevel = this.dzzyjzwjb[info.zyjzwLevel].dictLabel
          info.engineeringLevel = this.regcdb[info.engineeringLevel].dictLabel
          info.engineeringScale = this.regcgm[info.engineeringScale].dictLabel
          let list = []
          info.reservoirFunctionArr.forEach((v, i) => {
            list.push(this.reuse[v].dictLabel)
          })
          info.reservoirFunctionArr = list.join('，')

          this.info = info
        })
      }
    },
  }
</script>

<style lang="scss" scoped>
  .base {
    width: 100%;
    border-top: 1px solid #e9e7e7;

    .list {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20rpx 25rpx;
      border-bottom: 1px solid #e9e7e7;
      font-size: 30rpx;
      line-height: 50rpx;
      color: #7b7b7b;

      .list_left {}

      .list_right {
        width: 60%;
        text-align: right;
      }
    }
  }
</style>
